#pragma once
#include <Communication.h>

#define RESET 0.0f
#include <HeadInstructionHandler.h>
class AiboHeadControl
{
public:
	AiboHeadControl( HeadInstructionHandler* headHandler );
	~AiboHeadControl(void);

	float getTilt() { return this->m_tilt; }
	float getPan() { return this->m_pan; }
	float getRoll() { return this->m_roll; }

	void setTilt( double tilt );
	void setPan( double pan );
	void setRoll( double roll );

	void rollUp();
	void rollDown();
	void panLeft();
	void panRight();
	void tiltUp();
	void tiltDown();

	void centerHead();
	void centerTilt();
	void centerPan();
	void centerRoll();

	bool isCentered();	//Checks if all tilt, roll and pan values are set to 0.0f
	bool isWithinOne( float value ); // Checks if the values are all between -1.0f - 1.0f
	HeadInstructionHandler* getHeadHandler() { return this->m_headHandler; }
	void setHeadHandler( HeadInstructionHandler* walkHandler ) { this->m_headHandler = walkHandler; }
private:
	float convertToWithinOne( float value ); // Returns a float value between -1.0f - 1.0f
	float m_tilt;
	float m_pan;
	float m_roll;
	HeadInstructionHandler* m_headHandler;
};

